<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Module: Rails::Generator</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Module</strong></td>
          <td class="class-name-in-header">Rails::Generator</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../files/vendor/rails/railties/lib/rails_generator/base_rb.html">
                vendor/rails/railties/lib/rails_generator/base.rb
                </a>
        <br />
                <a href="../../files/vendor/rails/railties/lib/rails_generator/commands_rb.html">
                vendor/rails/railties/lib/rails_generator/commands.rb
                </a>
        <br />
                <a href="../../files/vendor/rails/railties/lib/rails_generator/generated_attribute_rb.html">
                vendor/rails/railties/lib/rails_generator/generated_attribute.rb
                </a>
        <br />
                <a href="../../files/vendor/rails/railties/lib/rails_generator/lookup_rb.html">
                vendor/rails/railties/lib/rails_generator/lookup.rb
                </a>
        <br />
                <a href="../../files/vendor/rails/railties/lib/rails_generator/manifest_rb.html">
                vendor/rails/railties/lib/rails_generator/manifest.rb
                </a>
        <br />
                <a href="../../files/vendor/rails/railties/lib/rails_generator/options_rb.html">
                vendor/rails/railties/lib/rails_generator/options.rb
                </a>
        <br />
                <a href="../../files/vendor/rails/railties/lib/rails_generator/scripts_rb.html">
                vendor/rails/railties/lib/rails_generator/scripts.rb
                </a>
        <br />
                <a href="../../files/vendor/rails/railties/lib/rails_generator/simple_logger_rb.html">
                vendor/rails/railties/lib/rails_generator/simple_logger.rb
                </a>
        <br />
                <a href="../../files/vendor/rails/railties/lib/rails_generator/spec_rb.html">
                vendor/rails/railties/lib/rails_generator/spec.rb
                </a>
        <br />
            </td>
        </tr>

        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
<a href="Generator.html">Rails::Generator</a> is a code generation platform
tailored for the <a href="../Rails.html">Rails</a> web application
framework. Generators are easily invoked within <a
href="../Rails.html">Rails</a> applications to add and remove components
such as models and controllers. New generators are easy to create and may
be distributed as RubyGems, tarballs, or <a href="../Rails.html">Rails</a>
plugins for inclusion system-wide, per-user, or per-application.
</p>
<p>
For actual examples see the rails_generator/generators directory in the <a
href="../Rails.html">Rails</a> source (or the <tt>railties</tt> directory
if you have frozen the <a href="../Rails.html">Rails</a> source in your
application).
</p>
<p>
Generators may subclass other generators to provide variations that require
little or no new logic but replace the template files.
</p>
<p>
For a RubyGem, put your generator class and templates in the <tt>lib</tt>
directory. For a <a href="../Rails.html">Rails</a> plugin, make a
<tt>generators</tt> directory at the root of your plugin.
</p>
<p>
The layout of generator files can be seen in the built-in
<tt>controller</tt> generator:
</p>
<pre>
  generators/
    components/
      controller/
        controller_generator.rb
        templates/
          controller.rb
          functional_test.rb
          helper.rb
          view.html.erb
</pre>
<p>
The directory name (<tt>controller</tt>) matches the name of the generator
file (controller_generator.rb) and class (<tt>ControllerGenerator</tt>).
The files that will be copied or used as templates are stored in the
<tt>templates</tt> directory.
</p>
<p>
The filenames of the templates don&#8216;t matter, but choose something
that will be self-explanatory since you will be referencing these in the
<tt>manifest</tt> method inside your generator subclass.
</p>

    </div>


   </div>


  </div>


    <!-- if includes -->

    <div id="section">

    <div id="class-list">
      <h3 class="section-bar">Classes and Modules</h3>

      Module <a href="Generator/Commands.html" class="link">Rails::Generator::Commands</a><br />
Module <a href="Generator/Lookup.html" class="link">Rails::Generator::Lookup</a><br />
Module <a href="Generator/Options.html" class="link">Rails::Generator::Options</a><br />
Module <a href="Generator/Scripts.html" class="link">Rails::Generator::Scripts</a><br />
Class <a href="Generator/AbstractGemSource.html" class="link">Rails::Generator::AbstractGemSource</a><br />
Class <a href="Generator/Base.html" class="link">Rails::Generator::Base</a><br />
Class <a href="Generator/GemGeneratorSource.html" class="link">Rails::Generator::GemGeneratorSource</a><br />
Class <a href="Generator/GemPathSource.html" class="link">Rails::Generator::GemPathSource</a><br />
Class <a href="Generator/GeneratedAttribute.html" class="link">Rails::Generator::GeneratedAttribute</a><br />
Class <a href="Generator/GeneratorError.html" class="link">Rails::Generator::GeneratorError</a><br />
Class <a href="Generator/Manifest.html" class="link">Rails::Generator::Manifest</a><br />
Class <a href="Generator/NamedBase.html" class="link">Rails::Generator::NamedBase</a><br />
Class <a href="Generator/PathSource.html" class="link">Rails::Generator::PathSource</a><br />
Class <a href="Generator/Source.html" class="link">Rails::Generator::Source</a><br />
Class <a href="Generator/Spec.html" class="link">Rails::Generator::Spec</a><br />
Class <a href="Generator/UsageError.html" class="link">Rails::Generator::UsageError</a><br />

    </div>




      


    <!-- if method_list -->


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>